package com.Shoping.service.impl;

import com.Shoping.dao.UserDao;
import com.Shoping.dao.impl.UserDaoImpl;
import com.Shoping.entity.User;
import com.Shoping.service.UserService;

import java.sql.SQLException;

public class UserServiceImpl implements UserService {
    private UserDao userDao = new UserDaoImpl();
    @Override
    public User selectByNamePwd(String userName, String password) throws SQLException {
        return userDao.selectByNamePwd(userName, password);
    }

    @Override
    public User selectByUsername(String userCode) throws SQLException {
        return userDao.selectByUsername(userCode);
    }

    @Override
    public void createUser(String userCode, String newPassword, String uImg, Integer uCategory, String uArea) throws SQLException {
        userDao.createUser(userCode,newPassword,uImg,uCategory,uArea);
    }

    @Override
    public void updatePassowrd(String password,Integer uid) throws SQLException {
        userDao.updatePassowrd(password,uid);
    }

    @Override
    public void insertByInformation(String uName, String uBirthday, String uSex,Integer uId) throws SQLException {
        userDao.insertByInformation(uName,uBirthday,uSex,uId);

    }

    @Override
    public User selectByUid(Integer uId) throws SQLException {
        return userDao.selectByUid(uId);
    }

    @Override
    public void updateImg(Integer getuId, String s) throws SQLException {
        userDao.updateImg(getuId,s);
    }
}
